#pragma once
#include "IDataSorcue.h"
#include <string>
#include <vector>

using namespace std;


class cDataSourceCVS: public IDataSource
{
public:
	cDataSourceCVS(void);
	
	// data
	cDataSourceCVS(const char* SourceName,const char* data);
	~cDataSourceCVS(void);

	// Interface
	const char* GetDataSourceName(void) const; 
	int GetRowCount(void) const;
	int GetColumnNumber(const char* Column) const;
	const char* GetValue(const char* ColumnName, int Row) const;
	const char* GetValue(unsigned int Column,unsigned int Row) const ;
	
private:
	int ParseData(const char* data);
	string DataSourceName;
	vector<string> ColumnName;
	vector<vector<string>> Data;

	const vector<string> GetSubStringBySeparator(string line,char separator );

};
